home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{50CBA22D-9024-11D1-AD8F-8E94A5273767}#8.5#0"; "TranImg2.ocx"
- Begin VB.Form frmBounce
- BackColor = &H00FFFFFF&
- Caption = "TransImg Animated Bounce Example"
- ClientHeight = 1512
- ClientLeft = 48
- ClientTop = 276
- ClientWidth = 4104
- Icon = "Bounce.frx":0000
- LinkTopic = "Form1"
- Picture = "Bounce.frx":0442
- ScaleHeight = 126
- ScaleMode = 3 'Pixel
- ScaleWidth = 342
- StartUpPosition = 1 'CenterOwner
- Begin VB.Timer Timer1
- Interval = 10
- Left = 3696
- Top = 792
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 7
- Left = 3228
- Picture = "Bounce.frx":1CC78
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 8
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 6
- Left = 2784
- Picture = "Bounce.frx":1D8BA
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 7
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 5
- Left = 2328
- Picture = "Bounce.frx":1E4FC
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 6
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 4
- Left = 1884
- Picture = "Bounce.frx":1F13E
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 5
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 3
- Left = 1440
- Picture = "Bounce.frx":1FD80
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 4
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 2
- Left = 996
- Picture = "Bounce.frx":209C2
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 3
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 1
- Left = 552
- Picture = "Bounce.frx":21604
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 2
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin VB.PictureBox Pic
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Index = 0
- Left = 108
- Picture = "Bounce.frx":22246
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 1
- Top = 1092
- Visible = 0 'False
- Width = 384
- End
- Begin DevPowerTransImg.TransImg TransImg1
- Height = 384
- Left = 336
- TabIndex = 0
- Top = 120
- Width = 384
- _ExtentX = 677
- _ExtentY = 677
- MaskColor = 12434877
- Transparent = -1 'True
- Picture = "Bounce.frx":22E88
- End
- Begin VB.Label lblMessage
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "Chase the moon with your mouse."
- BeginProperty Font
- Name = "Tahoma"
- Size = 7.8
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000080&
- Height = 192
- Left = 720
- TabIndex = 10
- Top = 876
- Width = 2592
- End
- Begin VB.Label lblTitle
- Alignment = 2 'Center
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "DevPower TransImg Bounce"
- BeginProperty Font
- Name = "Tahoma"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000080&
- Height = 288
- Left = 288
- TabIndex = 9
- Top = 540
- Width = 3456
- End
- Attribute VB_Name = "frmBounce"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private iCurr As Integer
- Private bDown As Boolean
- Private bRight As Boolean
- Private iMsg As Integer
- Private bChangeMsg As Boolean
- Private Sub Form_Load()
- TransImg1.ZOrder
- bDown = True
- bRight = True
- End Sub
- Private Sub Form_Resize()
- lblTitle.Top = (Me.ScaleHeight - lblTitle.Height - lblMessage.Height - 2) / 2
- lblTitle.Left = (Me.ScaleWidth - lblTitle.Width) / 2
- lblMessage.Top = lblTitle.Top + lblTitle.Height + 2
- lblMessage.Left = 0
- lblMessage.Width = Me.ScaleWidth
- If bDown And (TransImg1.Top + TransImg1.Height > Me.ScaleHeight) Then TransImg1.Top = Me.ScaleHeight - TransImg1.Height
- If bRight And (TransImg1.Left + TransImg1.Width > Me.ScaleWidth) Then TransImg1.Left = Me.ScaleWidth - TransImg1.Width
- End Sub
- Private Sub Timer1_Timer()
- Dim iDX As Integer, iDY As Integer
- If iCurr > 7 Then iCurr = 0
- Set TransImg1.Picture = Pic(iCurr).Picture
- iCurr = iCurr + 1
- ' Still going down?
- If TransImg1.Top + TransImg1.Height > Me.ScaleHeight Then bDown = False
- If TransImg1.Top < 0 Then bDown = True
- ' Still going right?
- If TransImg1.Left + TransImg1.Width > Me.ScaleWidth Then bRight = False
- If TransImg1.Left < 0 Then bRight = True
- If bDown Then
- iDY = 2
- Else
- iDY = -2
- End If
- If bRight Then
- iDX = 2
- Else
- iDX = -2
- End If
-
- TransImg1.Move TransImg1.Left + iDX, TransImg1.Top + iDY
- End Sub
- Private Sub TransImg1_Click()
- Timer1.Enabled = Not Timer1.Enabled
- End Sub
- Private Sub TransImg1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
- iMsg = iMsg + 1
- If iMsg > 300 Then iMsg = 1
- If iMsg < 50 Then
- lblMessage.Caption = "Chase the moon with your mouse."
- ElseIf iMsg < 75 Then
- lblMessage.Caption = "Click to stop and start animation."
- ElseIf iMsg < 150 Then
- lblMessage.Caption = "Demo of transparency and ... "
- ElseIf iMsg < 225 Then
- lblMessage.Caption = "improved display for animation purposes"
- End If
- End Sub
-